package dl.bukkit.myststus.hook;

import dl.bukkit.myststus.MyStatus;
import dl.bukkit.myststus.library.container.ListContainer;
import dl.bukkit.myststus.loader.Loader;
import dl.bukkit.myststus.logger.Logger;


import java.util.ArrayList;

public class HookManager implements Loader {

    private final ListContainer<IHook> container;

    private HookManager(MyStatus plugin) {
        this.container = new ListContainer<>(new ArrayList<>());
    }

    @Override
    public void onLoad() {
        container.register(VexViewHook.class);
        container.register(PlaceholderAPIHook.class);
    }

    @Override
    public void staring() {
        container.getList().forEach(iHook -> {
            if (iHook.isEnable()) {
                Logger.consoleMessage("Find ", iHook.getPlugin());
            }else {
                Logger.consoleMessage("Not find ", iHook.getPlugin());
            }
        });
    }
}
